package ooday02.practise;

public class Teacher extends Person{
    private  double salary;
    public Teacher(){

    }
    public Teacher(String name,int age,String address,double salary){
        super(name, age, address);
        this.salary=salary;
    }

    @Override
    public void eat() {
        System.out.println("薪水"+salary+getName()+"老师吃饭");
    }

    @Override
    public void sleep() {
        super.sleep();
    }

    @Override
    public void play() {
        super.play();
    }

    public void  teach(){
        System.out.println(getName()+"老师在教书");
    }


    /**
     * 获取
     * @return salary
     */
    public double getSalary() {
        return salary;
    }

    /**
     * 设置
     * @param salary
     */
    public void setSalary(double salary) {
        this.salary = salary;
    }

    public String toString() {
        return "Teacher{salary = " + salary + "}";
    }
}
